package org.webscale.amazinggwt.client.util;

import com.extjs.gxt.ui.client.widget.Info;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public abstract class AsyncAdapter<T> implements AsyncCallback {
	
	public void onSuccess(Object obj) {
		onComplete((T) obj);
	}
	
	public abstract void onComplete(T result);

	public void onFailure(Throwable th) {
		GWT.log("Error :", th);
		th.printStackTrace();
		Info.display("Error :",th.getMessage());
	}
}